✨ Add destructurable integer_sequence#335
Merged
elbeno merged 3 commits intointel:mainfrom Mar 5, 2026
Merged
Conversation
Problem: - With clang backporting "structured bindings can introduce a pack", it would be very useful to be able to destructure an `integer_sequence`, to avoid having to do the usual call of an immediately-invoked lambda expression. Solution: - Add `make_integer_sequence` and `make_index_sequence` that can be destructured. Note: - This is first available in clang-21.
Problem: - It's useful to be able to pass an `integer_sequence` into tuple algorithms like `unrolled_for_each`. Solution: - Change tuple algorithms to use `get` rather than indexing. - Add specialization of `tuple_size_v` for `integer_sequence`. - Add specialization of `get` for `span`.
Problem: - There is no documentation explaining `stdx::make_integer_sequence` and friends. Solution: - Add the docs.
mjcaisse-intel
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
integer_sequence, to avoid having to do the usual call of an immediately-invoked lambda expression.Solution:
make_integer_sequenceandmake_index_sequencethat can be destructured.Note: